package com.tencent.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author: Fame
 * @date: 2022-08-08 10:37
 * @description:
 */
@ComponentScan("com.tencent")
@EnableWebMvc
public class SpringMvcConfig implements WebMvcConfigurer {

    @Bean("multipartResolver")
    public CommonsMultipartResolver commonsMultipartResolver(){
        return  new CommonsMultipartResolver();
    }

    @Override
    public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
        configurer.enable();
    }
}
